The present invention relates to computer graphics and animation. More specifically, the present invention relates to techniques for processing object oriented representations of computer graphics data to render animated geometric model scenes using a shading language.
Many computer graphic images are created by mathematically modeling the interaction of light with a three dimensional scene from a given viewpoint. This process, called rendering, generates a two-dimensional image of the scene from the given viewpoint, and is analogous to taking a photograph of a real-world scene. Animated sequences can be created by rendering a sequence of images of a scene as the scene changes over time. A great deal of effort has been devoted to making realistic looking rendered images and animations.
In a typical shader language, a user (e.g., a programmer) can use surface attribute functions to define the values of attributes of surfaces in three-dimensional space. Such surface attribute functions can be evaluated at any point on the surface to provide corresponding attribute values at that point on the surface. Attributes of surfaces can include optical properties of a surface, such as color, transparency, reflectivity, and transmissivity. Attributes can also include visibility or occlusion information; artistically or procedurally generated texture data in one, two, three, or more dimensions; shadow generation information; illumination information, which specifies the amount and direction of light on the surface point from other portions of the scene; and rendering information, such as ray tracing path information or radiosity rendering information. Functions can be relatively simple, such as looking up texture data from a texture map, or very complex, such as the evaluation of a complex user-defined shader program, ray tracing program, animation or modeling program, or simulation program.
The process of rendering an image or frame of animation can be a very time-consuming process. Some shader interpreters, such as RenderMan™, use a SIMD (Single Instruction Multiple Datastream) architecture. A SIMD shading language interpreter is able to execute instructions once for a set of computer graphics data points, saving significantly over the redundant instruction dispatch of a conventional SISD (Single Instruction Single Datastream) architecture. However, in an object-oriented shading language, if per-point data of a particular class can have different subclasses at different points, then virtual methods may require different code to be executed at each point, negating the advantages of SIMD interpretation.
Accordingly, what is desired are improved methods and apparatus for solving some of the problems discussed above.